package com.ldzl.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.ldzl.dto.QueryInventoryNumDTO;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 库存上下限表
 * @TableName ck_warning
 */
@TableName(value ="ck_warning")
@Data
public class CkWarning implements Serializable {
    /**
     * 库存预警ID
     */
    @TableId(type = IdType.AUTO)
    private Long warning_id;

    /**
     * 仓库ID
     */
    private Long warehouse_id;

    /**
     * 商品ID
     */
    private Long product_id;

    /**
     * 商品编号
     */
    private String product_code;

    /**
     * 商品名称
     */
    private String product_name;

    /**
     * 单位ID
     */
    private Long unit_id;

    /**
     * 单位名称
     */
    private String unit_name;

    /**
     * 库存上限
     */
    private BigDecimal max_stock;

    /**
     * 库存下限
     */
    private BigDecimal min_stock;

    /**
     * 创建人
     */
    private String create_by;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

    /**
     * 更新人
     */
    private String update_by;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private String is_delete;

    /**
     * 当前库存数量
     */
    @TableField(exist = false)
    private QueryInventoryNumDTO queryNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CkWarning other = (CkWarning) that;
        return (this.getWarning_id() == null ? other.getWarning_id() == null : this.getWarning_id().equals(other.getWarning_id()))
            && (this.getWarehouse_id() == null ? other.getWarehouse_id() == null : this.getWarehouse_id().equals(other.getWarehouse_id()))
            && (this.getProduct_id() == null ? other.getProduct_id() == null : this.getProduct_id().equals(other.getProduct_id()))
            && (this.getProduct_code() == null ? other.getProduct_code() == null : this.getProduct_code().equals(other.getProduct_code()))
            && (this.getProduct_name() == null ? other.getProduct_name() == null : this.getProduct_name().equals(other.getProduct_name()))
            && (this.getUnit_id() == null ? other.getUnit_id() == null : this.getUnit_id().equals(other.getUnit_id()))
            && (this.getUnit_name() == null ? other.getUnit_name() == null : this.getUnit_name().equals(other.getUnit_name()))
            && (this.getMax_stock() == null ? other.getMax_stock() == null : this.getMax_stock().equals(other.getMax_stock()))
            && (this.getMin_stock() == null ? other.getMin_stock() == null : this.getMin_stock().equals(other.getMin_stock()))
            && (this.getCreate_by() == null ? other.getCreate_by() == null : this.getCreate_by().equals(other.getCreate_by()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()))
            && (this.getUpdate_by() == null ? other.getUpdate_by() == null : this.getUpdate_by().equals(other.getUpdate_by()))
            && (this.getUpdate_time() == null ? other.getUpdate_time() == null : this.getUpdate_time().equals(other.getUpdate_time()))
            && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWarning_id() == null) ? 0 : getWarning_id().hashCode());
        result = prime * result + ((getWarehouse_id() == null) ? 0 : getWarehouse_id().hashCode());
        result = prime * result + ((getProduct_id() == null) ? 0 : getProduct_id().hashCode());
        result = prime * result + ((getProduct_code() == null) ? 0 : getProduct_code().hashCode());
        result = prime * result + ((getProduct_name() == null) ? 0 : getProduct_name().hashCode());
        result = prime * result + ((getUnit_id() == null) ? 0 : getUnit_id().hashCode());
        result = prime * result + ((getUnit_name() == null) ? 0 : getUnit_name().hashCode());
        result = prime * result + ((getMax_stock() == null) ? 0 : getMax_stock().hashCode());
        result = prime * result + ((getMin_stock() == null) ? 0 : getMin_stock().hashCode());
        result = prime * result + ((getCreate_by() == null) ? 0 : getCreate_by().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        result = prime * result + ((getUpdate_by() == null) ? 0 : getUpdate_by().hashCode());
        result = prime * result + ((getUpdate_time() == null) ? 0 : getUpdate_time().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", warning_id=").append(warning_id);
        sb.append(", warehouse_id=").append(warehouse_id);
        sb.append(", product_id=").append(product_id);
        sb.append(", product_code=").append(product_code);
        sb.append(", product_name=").append(product_name);
        sb.append(", unit_id=").append(unit_id);
        sb.append(", unit_name=").append(unit_name);
        sb.append(", max_stock=").append(max_stock);
        sb.append(", min_stock=").append(min_stock);
        sb.append(", create_by=").append(create_by);
        sb.append(", create_time=").append(create_time);
        sb.append(", update_by=").append(update_by);
        sb.append(", update_time=").append(update_time);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}